<template>

	<view class="container">
		<uni-card  v-for="(item,index) in recordingData" :key="index" :title="'批次号：'+item.pch" :sub-title="'状态:'+item.zt" :extra="'后送方式：'+item.fs">
			<uni-list  :border="false">
				<uni-list-item  v-for="(key,i) in item.hs" :key="i" :title="key.xm||'--'" @click="goToDetail(item,i)" link></uni-list-item>
			</uni-list>
		</uni-card>
		<uni-load-more :status="status" :contentText="contentText" />
	</view>
</template>
<script>
	import { inquireRecording } from '../../api/huanzhe.js'
	import { useRouter } from '../../utils/utils.js'
	export default {
		data() {
			return {
				recordingData:[],
				status: 'more',
				contentText: {
					contentdown: '上拉加载更多',
					contentrefresh: '加载中',
					contentnomore: '我也是有底线的~'
				},
				InquireData:{
					pageNum:1,
					pageSize: 20
				},
				
			}
		},
		onLoad(){
			this.inquireQuery()
		},
		onReachBottom(e){
			this.status = 'loading'
			this.InquireData.pageNum++;
			this.inquireQuery()
		},
		onPullDownRefresh() {
			this.InquireData.pageNum = 1;
			this.inquireQuery()
		},
		methods: {
			// 后送记录查询
			inquireQuery(){
				inquireRecording(this.InquireData).then(res=>{
					
				if (!res.rows.length) {
					this.status = 'no-more'
				} else {
					this.status = 'more'
				}
				if (this.recordingData.length) {
					this.recordingData.push(...res.rows)
				} else {
					console.log(res.rows);
					this.recordingData = res.rows
				}
				})
			},
			goToDetail(item,i){
				console.log(item,i);
				useRouter('/pages/evacuationRecording/detailRecording',{
					pc:item.pch,
					lx:item.lx,
					fs:item.fs,
					gxztsj:item.gxztsj,
					sw:item.sw,
					bz:item.bz,
					zt:item.zt,
					xm:item.hs[i].xm,
					sj:item.hs[i].sj,
					tw:item.hs[i].tw,
					dj:item.hs[i].dj,
					hszt:item.hs[i].zt
				},'navigateTo')
			}
		}
	}
</script>
<style lang="scss">
</style>